<?php

use App\Http\Controllers\Api\WangguiApiController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Kuafu\IpWhite\Controller\IpWhiteController;
use Kuafu\IpWhite\Middleware\KfNetMiddleware;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::get('/hello', function (Request $request) {
    return response()->json(['code' => 200, 'msg' => '', 'data' => []]);
});

// 微信H5支付调试
Route::any('wxWapPay', [\App\Http\Controllers\HelloController::class, 'wxWapPay']);

// 支付宝H5支付调试
Route::any('aliWapPay', [\App\Http\Controllers\HelloController::class, 'aliWapPay']);

// 内网白名单
Route::prefix('ip-white')->group(function () {
    Route::get('forceLoginOut', [IpWhiteController::class, 'forceLoginOut']);
    Route::get('userLists', [IpWhiteController::class, 'userLists']);
    Route::get('totalLists', [IpWhiteController::class, 'totalLists']);
});

// 内部手动处理
Route::prefix('inner-manual')->middleware(KfNetMiddleware::class)->group(function () {

    // 刷新三方供应商飞书人员信息
    Route::get('refreshFsExtUser', [\App\Http\Controllers\Common\FsUserController::class, "refreshFsExtUser"]);

    // 刷新省区开发
    Route::get('refreshProvinceDeveloper', [\App\Http\Controllers\Common\FsUserController::class, "refreshProvinceDeveloper"]);

});

// 预测数据导入
Route::get('import/wgPrediction', [WangguiApiController::class, 'importWgPrediction']);

